﻿
/*
 * Add a check to UDS_Flow_Step.Step_ID to ensure that Step_ID is already greater than zero.
 */
 IF NOT EXISTS (SELECT 1 FROM sys.check_constraints WHERE object_id = OBJECT_ID(N'[dbo].[CK_UDS_Flow_Step_StepID]') AND parent_object_id = OBJECT_ID(N'[dbo].[UDS_Flow_Step]'))
 BEGIN
    ALTER TABLE [dbo].[UDS_Flow_Step] ADD
        CONSTRAINT [CK_UDS_Flow_Step_StepID] CHECK (([Step_ID] > 0) OR ([Step_ID] = -1));
 END;
 GO
 